package collection.mymap.enummap;

import java.util.ArrayList;
import java.util.EnumMap;
import org.testng.annotations.Test;

public class EnumMap1 {

    /**
     *
     */
    @Test
    public void t1() {
        EnumMap<Season, Integer> map = new EnumMap<>(Season.class);



        map.put(Season.SPRING, 100);
        map.forEach((k, v) -> System.out.println(k + "" + v));
        System.out.println(map.get(Season.SPRING));
        System.out.println(map);
    }


}

enum Season {

    SPRING(0),
    SUMMER(1),
    FAIL(2),
    WINTER(3);

    private int id;

    Season(int id) {
        this.id = id;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
}
